<template>
  <s-modal
    title="详情"
    :visible="visible"
    width="800px"
    :footer="null"
    @cancel="visible=false"
  >
    <div style="height:400px">
      <s-scroll>
        <s-form :value="formValue">
          <s-form-item
            label="文件名称"
            size="middle"
            name="fileName"
            :colon="true"
            :display-title="true"
            :rules="[{'max':50,'message':'最长为50位'}]"
          >
            <s-input
              :allow-clear="true"
              placeholder="请输入文件名称"
              v-model="formValue.fileName"
              disabled
              />
          </s-form-item>
          <s-form-item
            label="文件类型"
            size="middle"
            name="fileType"
            :colon="true"
            :display-title="true"
            :rules="[{'max':10,'message':'最长为10位'}]"
          >
            <s-input
              :allow-clear="true"
              placeholder="请输入文件类型"
              v-model="formValue.fileType"
              disabled
              />
          </s-form-item>
          <s-form-item
            label="文件大小"
            size="middle"
            name="fileSize"
            :colon="true"
            :display-title="true"
            :rules="[{'max':30,'message':'最长为30位'}]"
          >
            <s-input
              :allow-clear="true"
              placeholder="请输入文件大小"
              v-model="formValue.fileSize"
              disabled
              />
          </s-form-item>
          <s-form-item
            label="上传时间"
            size="middle"
            name="uploadTime"
            :colon="true"
            :display-title="true"
          >
            <s-input
              :allow-clear="true"
              placeholder="请输入上传时间"
              v-model="formValue.uploadTime"
              disabled
              />
          </s-form-item>
          <s-form-item
            label="报表周期"
            size="middle"
            name="reportingCycle"
            :colon="true"
            :display-title="true"
            :rules="[{'max':4,'message':'最长为4位'}]"
          >
            <s-input
              :allow-clear="true"
              placeholder="请输入报表周期"
              v-model="formValue.reportingCycle"
              disabled
              />
          </s-form-item>

          <s-form-item
            label="创建人"
            prop="createByAccount"
          >
            <s-input
              :allow-clear="true"
              v-model="formValue.createByAccount"
              disabled
              />
          </s-form-item>
          <s-form-item
            label="创建时间"
            prop="createDate"
          >
            <s-input
              :allow-clear="true"
              v-model="formValue.createDate"
              disabled
              />
          </s-form-item>
		  <s-form-item
            label="修改人"
            prop="updateByAccount"
          >
            <s-input
              :allow-clear="true"
              v-model="formValue.updateByAccount"
              disabled
              />
          </s-form-item>
          <s-form-item
            label="修改时间"
            prop="updateDate"
          >
            <s-input
              :allow-clear="true"
              v-model="formValue.updateDate"
              disabled
              />
          </s-form-item>
        </s-form>
      </s-scroll>
    </div>
  </s-modal>
</template>

<script>

export default {
  name: 'Detail',
  data() {
    return {
      formValue: {},
      visible: false
    }
  },
  methods: {
    open(id) {
      this.formValue = {}
      this.$loading(true)
      this.$api.GET('/modules/doorReportFile/selectOneById', { id: id }).then((res) => {
        if (!res.data) {
          this.$loading(false)
          this.visible = false
          this.$message.warn('数据不存在')
        } else {
          this.formValue = res.data
          this.$loading(false)
          this.visible = true
        }
      }).catch(() => {
        this.$loading(false)
      })
    }
  }
}
</script>

<style lang="less" scoped>

</style>